home *** CD-ROM | disk | FTP | other *** search
/ VRML 2.0 Sourcebook (2nd Edition) / VRML 2.0 Sourcebook CD [md5 fed90f4f9c39d5a60d477058775c7e21].iso / book / win / ch08 / 08fig08.wrl < prev   
Text File  |  1996-09-23  |  2KB  |  85 lines

  1. #VRML V2.0 utf8
  2. # The VRML 2.0 Sourcebook
  3. # Copyright 1997 By
  4. # Andrea L. Ames, David R. Nadeau, and John L. Moreland
  5. Group {
  6.     children [
  7.     # Stationary Sun
  8.         Shape {
  9.             appearance DEF White Appearance {
  10.                 material Material { }
  11.             }
  12.             geometry Sphere { }
  13.         },
  14.     # Several orbiting planets
  15.         DEF Planet1 Transform {
  16.             translation 2.0 0.0 0.0
  17.             center -2.0 0.0 0.0
  18.             children Shape {
  19.                 appearance USE White
  20.                 geometry Sphere { radius 0.2 }
  21.             }
  22.         },
  23.         DEF Planet2 Transform {
  24.             translation 3.0 0.0 0.0
  25.             center -3.0 0.0 0.0
  26.             children Shape {
  27.                 appearance USE White
  28.                 geometry Sphere { radius 0.3 }
  29.             }
  30.         },
  31.         DEF Planet3 Transform {
  32.             translation 4.0 0.0 0.0
  33.             center -4.0 0.0 0.0
  34.             children Shape {
  35.                 appearance USE White
  36.                 geometry Sphere { radius 0.5 }
  37.             }
  38.         },
  39.     # Animation clocks, one per planet
  40.         DEF Clock1 TimeSensor {
  41.             cycleInterval 2.0
  42.             loop TRUE
  43.         },
  44.         DEF Clock2 TimeSensor {
  45.             cycleInterval 3.5
  46.             loop TRUE
  47.         },
  48.         DEF Clock3 TimeSensor {
  49.             cycleInterval 5.0
  50.             loop TRUE
  51.         },
  52.     # Animation paths, one per planet
  53.         DEF PlanetPath1 OrientationInterpolator {
  54.             key [ 0.0, 0.50, 1.0 ]
  55.             keyValue [
  56.                 0.0 0.0 1.0  0.0,
  57.                 0.0 0.0 1.0  3.14,
  58.                 0.0 0.0 1.0  6.28
  59.             ]
  60.         },
  61.         DEF PlanetPath2 OrientationInterpolator {
  62.             key [ 0.0, 0.50, 1.0 ]
  63.             keyValue [
  64.                 0.0 0.0 1.0  0.0,
  65.                 0.0 0.0 1.0  3.14,
  66.                 0.0 0.0 1.0  6.28
  67.             ]
  68.         },
  69.         DEF PlanetPath3 OrientationInterpolator {
  70.             key [ 0.0, 0.50, 1.0 ]
  71.             keyValue [
  72.                 0.0 0.0 1.0  0.0,
  73.                 0.0 0.0 1.0  3.14,
  74.                 0.0 0.0 1.0  6.28
  75.             ]
  76.         }
  77.     ]
  78. }
  79. ROUTE Clock1.fraction_changed   TO PlanetPath1.set_fraction
  80. ROUTE Clock2.fraction_changed   TO PlanetPath2.set_fraction
  81. ROUTE Clock3.fraction_changed   TO PlanetPath3.set_fraction
  82. ROUTE PlanetPath1.value_changed TO Planet1.set_rotation
  83. ROUTE PlanetPath2.value_changed TO Planet2.set_rotation
  84. ROUTE PlanetPath3.value_changed TO Planet3.set_rotation
  85.